package com.example.hibernate.pojos;


@SuppressWarnings("serial")
public class Users implements IUsers{

	private int ffid = 0;
	private String userName = "username";
	private String password = "password";


	public int getFfid() {
		return ffid;
	}
	public void setFfid(int ffid) {
		this.ffid = ffid;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Override
	public String toString() {
		return userName + ":" + password;
	}
	public boolean validate(String userName, String password) {
		trimAllValues();
		if (userName.equalsIgnoreCase(this.userName) && password.equals(this.password))
			return true;
		return false;
	}
	
	private void trimAllValues() {
		this.password = this.password.trim();
		this.userName = this.userName.trim();
		
	}
	public boolean validatePassword(String password){
		trimAllValues();
		if (password.equals(this.password))
			return true;
		return false;
	}
	
	
}
